import service from '@/utils/http-util';

export const useUserApi = () => {
  return {
    getUserInfo: () => {
      return service.get('/user/getUserInfo');
    },
    getUserList: (params) => {
      return service.get('/user/getUserList', {
        params,
      });
    },
    addUser: (data) => {
      return service.post('/user/addUser', data);
    },
    // 修改用户
    updateUser: (data) => {
      return service.put('/user/updateUser', data);
    },
    // 删除用户
    deleteUser: (username) => {
      return service.delete('/user/delete/' + username);
    },
    // 修改密码
    modifyPassword(data) {
      return service.put('/user/modifyPassword', data);
    },
  };
};
